const state = {
  token: '',
  userId: '',
  userInfo: {},
  shopCarNum: 0,
  isGetCarNum: false,
  linkUsInfo: {}, // 联系我们信息
  isGetLinkUs: false // 是否已获取联系我们
};

const mutations = {
  SET_TOKEN(state, data) {
    state.token = data;
  },
  SET_USERID(state, data) {
    state.userId = data;
  },
  SET_USERINFO(state, data) {
    state.userInfo = data;
  },
  SET_SHOPCARNUM(state, data) {
    state.shopCarNum = data;
  },
  SET_ISGETCARNUM(state, data) {
    state.isGetCarNum = data;
  },
  SET_LINKUSINFO(state, data) {
    state.linkUsInfo = data;
  },
  SET_ISGETLINKUS(state, data) {
    state.isGetLinkUs = data;
  },
  RESET_STATE(state) {
    state.token = ''
    state.userId = ''
    state.userInfo = {}
    state.shopCarNum = 0
    state.isGetCarNum = false
    state.linkUsInfo = {}
    state.isGetLinkUs = false
  }
};

const actions = {
  // 主题详情
  // saveThemeInfo({
  //   commit
  // }, info) {
  //   // commit('saveThemeInfo', info)
  // }
};

export default {
  state,
  mutations,
  actions
};
